MMB-437: Support Different Date Formats For Tokens #97
+16
−13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
The current implementation for values of date tokens only support a fix format which is something like 31/Dec/2024. This pr adds the support for most of the different date formats that are supported by this function.
Before
Dates were being provided in just a single format for certificate date token values.
After
Now we can utilize this date formatting for certificate date tokens.
Technical Details
Currently we are providing string values for tokens, this pr changes the values to be a DateTime object so that civi formats the dates according to the given format. If no format is given then the default format that is defined in admin settings will be used